﻿@model ZoomLa.Model.M_Templata
@using System.Data
@using ZoomLa.Common
@using ZoomLa.BLL

@using ZoomLa.AppCode.Controls
@{
    B_Page pageBll=ViewBag.pageBll;
    SelectList styleList=ViewBag.styleList;
    int RegID=ViewBag.RegID;
}
@section head{<title>添加栏目</title>}
@section content{
<div class="container-fluid mysite" id="BreadDiv">
    <div class="row">
        <ol class="breadcrumb navbar-fixed-top" id="BreadNav">
            <li><a href='@(CustomerPageAction.customPath2)Main.aspx'>工作台</a></li>
            <li><a href="ApplyAudit">企业黄页</a></li>
            <li><a href="PageTemplate?ID=@RegID">模板列表</a></li>
            <li class='active'>模板管理</li>
        </ol>
    </div>
</div>
    <ul class="nav nav-tabs">
        <li class="active"><a href="#Tabs0" data-toggle="tab">基本信息</a></li>
        <li><a href="#Tabs1" data-toggle="tab">栏目选项</a></li>
        <li><a href="#Tabs2" data-toggle="tab">模板选项</a></li>
    </ul>
<form method="post" action="@MVCHelper.GetAction("PageTemplate_Add",Request)">
    <div class="tab-content panel-body padding0">
        <div id="Tabs0" class="tab-pane active">
            <table class="table table-striped table-bordered">
                <tbody>
                    <tr>
                        <td width="20%"><strong>栏目名称：</strong></td>
                        <td width="80%">
                            <input type="text" id="TemplateName" name="TemplateName" value="@Model.TemplateName" class="form-control text_300" title="栏目名称不能为空" />
                        </td>
                    </tr>
                    <tr id="11">
                        <td><strong>栏目类型</strong></td>
                        <td>
                            @MVCHelper.H_Radios("TemplateType", "单页型栏目,栏目型栏目,Url转发型栏目,功能型栏目".Split(','), "1,2,3,4".Split(','), Model.TemplateType.ToString())
                        </td>
                    </tr>
                    <tr id="Tr14">
                        <td><strong>打开方式：</strong></td>
                        <td>
                            @MVCHelper.H_Radios("OpenType", "新窗口打开,原窗口打开,父页面打开".Split(','), "_blank,_self,_top".Split(','), Model.OpenType)
                        </td>
                    </tr>
                    <tr id="Tr12" style="display: none;">
                        <td><strong>所属栏目：</strong></td>
                        <td>@ViewBag.pnode</td>
                    </tr>
                    <tr>
                        <td><strong>绑定样式：</strong></td>
                        <td>
                             @Html.DropDownListFor(m => m.UserGroup, styleList, new { @class = "form-control text_300" })
                        </td>
                    </tr>
                </tbody>
                @if (Model.TemplateType != 3 && Model.TemplateType != 4)
                {
                    <tr id="Tr6">
                        <td style="width: 20%;"><strong>栏目图片地址</strong></td>
                        <td>
                            <input type="text" id="Nodeimgurl" name="Nodeimgurl" value="@Model.Nodeimgurl" class="form-control text_300" />
                        </td>
                    </tr>
                    <tr id="Tr7">
                        <td><strong>栏目提示</strong></td>
                        <td>
                            <textarea id="Nodeimgtext" name="Nodeimgtext" class="form-control tarea_l" style="height:44px;width:433px;">@Model.Nodeimgtext</textarea>
                        </td>
                    </tr>
                    <tr id="Tr8">
                            <td>
                                <strong>说明：</strong><br />
                                用于在单页页详细介绍单页信息，支持HTML
                            </td>
                            <td>
                                <textarea id="Pagecontent" name="Pagecontent" class="form-control tarea_l" style="height:79px;width:433px;">@Model.Pagecontent</textarea>
                            </td>
                        </tr>
                }
            </table>
        </div>
        <div id="Tabs1" class="tab-pane">
            <table class="table table-striped table-bordered table-hover">
                <tbody>
                    <tr id="1">
                        <td width="20%"><strong>启用状态</strong></td>
                        <td>
                            @MVCHelper.H_Radios("IsTrue", "启用,停用".Split(','), "1,0".Split(','), Model.IsTrue.ToString())
                        </td>
                    </tr>
                    <tr id="Tr11">
                        <td>
                            <strong>排列顺序</strong><br />
                            <span>用于前台显示栏目顺序,越小越靠前</span>
                        </td>
                        <td>
                            <input type="text" id="OrderID" name="OrderID" class="form-control text_300" value="@Model.OrderID" />
                        </td>
                    </tr>
                    @if (Model.TemplateType != 0 && Model.TemplateType != 3 && Model.TemplateType != 4)
                    {
                        <tr id="Tr4">
                            <td>
                                <strong>栏目扩展名</strong><br />
                                例如：html、htm、shtml、aspx
                            </td>
                            <td>
                                @MVCHelper.H_Radios("NodeFileEx", "html,htm,shtml,aspx".Split(','), "html,htm,shtml,aspx".Split(','), Model.NodeFileEx)
                            </td>
                        </tr>
                    }
                    @if (Model.TemplateType != 1 && Model.TemplateType != 3 && Model.TemplateType != 4)
                    {
                        <tr id="Tr1">
                            <td>
                                <strong>内容页扩展名</strong><br />
                                例如：html、htm、shtml、aspx
                            </td>
                            <td>
                                @MVCHelper.H_Radios("ContentFileEx", "html,htm,shtml,aspx".Split(','), "html,htm,shtml,aspx".Split(','), Model.NodeFileEx)
                            </td>
                        </tr>
                    }
                    <tr id="Tr2">
                        <td><strong>添加时间</strong></td>
                        <td>
                            <input type="text" id="Addtime" name="Addtime" class="form-control text_300" value="@Model.Addtime.ToString("yyyy/MM/dd HH:mm:ss")" onclick="WdatePicker({ dateFmt: 'yyyy/MM/dd HH:mm:ss' });" />
                        </td>
                    </tr>
                    <tr id="Tr9">
                        <td>
                            <strong>META关键词：</strong><br />
                            针对搜索引擎设置的关键词
                        </td>
                        <td>
                            <textarea id="PageMetakeyword" name="PageMetakeyword" class="form-control" style="height:79px;width:433px;">@Model.PageMetakeyword</textarea>
                        </td>
                    </tr>
                    <tr id="Tr10">
                        <td>
                            <strong>META网页描述：</strong><br />
                            针对搜索引擎设置的网页描述
                        </td>
                        <td>
                            <textarea id="PageMetakeyinfo" name="PageMetakeyinfo" class="form-control" style="height:79px;width:433px;">@Model.PageMetakeyinfo</textarea>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div id="Tabs2" class="tab-pane">
            <table class="table table-striped table-bordered table-hover">
                <tbody>
                    @if (Model.TemplateType != 0 && Model.TemplateType != 1 && Model.TemplateType != 2 && Model.TemplateType != 4)
                    {
                        <tr id="Tr13" width="20%">
                            <td><strong>外部链接地址：</strong></td>
                            <td>
                                <input type="text" id="Linkurl" name="Linkurl" value="@Model.Linkurl" class="form-control tarea_l" />
                            </td>
                        </tr>
                        <tr id="Tr15">
                            <td><strong>外部链接图片地址：</strong></td>
                            <td>
                                <input type="text" id="Linkimg" name="Linkimg" value="@Model.Linkimg" class="form-control tarea_l" />
                            </td>
                        </tr>
                            <tr id="Tr16">
                                <td><strong>外部链接提示：</strong></td>
                                <td>
                                    <textarea id="Linktxt" name="Linktxt" class="form-control tarea_l" style="height:79px;">@Model.Linktxt</textarea>
                                </td>
                            </tr>
                    }
                        <tr>
                                <td><strong>栏目模板</strong></td>
                                <td>
                                    @MvcHtmlString.Create(PageCommon.GetTlpDP("TemplateUrl"))
                                    <input type="hidden" id="TemplateUrl_hid" name="TemplateUrl_hid" value="@Model.TemplateUrl" />
                                </td>
                            </tr>
                        <tr>
                        <td><strong>内容模型</strong></td>
                        <td>
                            @Html.Partial("C_PageModelSel",pageBll)
                        </td>
                    </tr>

                </tbody>
            </table>
        </div>
        <div class="text-center">
            <button type="submit" class="btn btn-primary">保存信息</button>
            <a href="ApplyAudit" class="btn btn-primary">返回列表</a>
        </div>
    </div>
</form>
@Html.Partial("C_TlpDP", new C_TlpDP("TemplateIndex",""))
}
@section script{
<script src="/JS/Controls/ZL_Dialog.js"></script>
<script src="/JS/DatePicker/WdatePicker.js"></script>
<script src="/JS/chinese.js"></script>
<script>
    $(function () {
        Tlp_initTemp();
    })
</script>
}